package com.itheima.app.controller;

import com.itheima.app.manager.MakeFriendManager;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;


@RestController
public class MakeFriendController {
    @Autowired
    private MakeFriendManager makeFriendManager;

    //今日佳人
    @GetMapping("/tanhua/todayBest")
    public ResponseEntity todayBest()  {
        return makeFriendManager.todayBest();
    }

    @GetMapping("/tanhua/recommendation")
    public ResponseEntity recommendation(
            @RequestParam(defaultValue = "1") Integer page,
            @RequestParam(defaultValue = "10") Integer pagesize)  {
        return makeFriendManager.recommendation(page,pagesize);
    }
    @GetMapping("/tanhua/{jiarenId}/personalInfo")
    public ResponseEntity personalInfo(@PathVariable Long jiarenId)  {
        return makeFriendManager.personalInfo(jiarenId);
    }
    @GetMapping("/users/{uid}/alreadyLove")
    public ResponseEntity alreadyLove(@PathVariable Long uid)  {
        return ResponseEntity.ok(false);
    }

    @GetMapping("/movements/visitors")
    public ResponseEntity findVisitors()  {
        return makeFriendManager.findVisitors();
    }

    @GetMapping("/tanhua/search")
    public ResponseEntity searchNear(String gender,Long distance)  {
        System.out.println("gender"+gender);
        System.out.println("distance"+distance);

        return makeFriendManager.searchNear(gender,distance);
    }
}